1. Field of the Invention
The present invention relates to a contrast compensation apparatus using histogram equalization and a method thereof, and more particularly, to a contrast compensation apparatus having a simplified hardware structure and a low contrast distortion and a method thereof.
2. Description of the Related Art
The basic principle of histogram equalization is to change features of a given image by varying a histogram of the image. A histogram shows a gray-level luminance distribution of an image. Such a gray-level histogram shows ratios of brightness to darkness, that is, contrast ratios, of an image, and the contrast ratios change when the histogram varies. In general, a high contrast ratio renders an image sharp, and a low contrast ratio renders an image blurry.
FIG. 1A and FIG. 1C are views illustrating the contrast concept, and FIG. 1B and FIG. 1D are views illustrating histograms for FIG. 1A and FIG. 1C, respectively.
The views shown in FIG. 1A and FIG. 1C illustrate an image and a contrast-enhanced image by histogram equalization, respectively. As shown in FIGS. 1A and 1C, the distinct luminance contrast between individual pixels forming an image facilitates the recognition of an image. FIG. 1B illustrates a histogram of luminance distribution for the image shown in FIG. 1A. As shown in FIG. 1B, pixels are clustered around an area having a low luminance. Accordingly, the luminance differences among the respective pixels forming the image are small, making the image hardly recognizable. FIG. 1D illustrates a histogram for the image shown in FIG. 1C. The luminance in the histogram illustrated in FIG. 1B is ramified in an expanded form. Accordingly, the respective pixels forming the image have different degrees of luminance, making the image easily recognizable.
FIG. 2 is a block diagram for showing a conventional contrast compensation device. The contrast compensation unit shown in FIG. 2 has a probability density function (PDF) calculation unit 10, a cumulative distribution function (CDF) calculation unit 20, and a mapping unit 30.
The PDF calculation unit 10 detects luminance degrees of respective pixels forming an input image, and calculates a probability density function based on the detection. The probability density function is a function that graphs the number of pixels having a specified luminance.
The CDF calculation unit 20 sequentially accumulates the probability density functions, and then obtains a cumulative distribution. Then, the cumulative distribution function is defined as in Formula 1 as follows:
                              CDF          =                                                    ∑                                  i                  =                  0                                n                            ⁢                                                          ⁢                                                PDF                  ⁡                                      (                    i                    )                                                  ⁢                                                                  ⁢                wherein                ⁢                                                                  ⁢                i                                      =            0                          ,        1        ,        2        ,                  3          ⁢                                          ⁢          …                                              Formula          ⁢                                          ⁢          1                ]            
The mapping unit 30 tends to map low luminance values of pixels into high luminance values based on a cumulative distribution function obtained by Formula 1 when the overall luminance of an input image is high.
FIG. 3A to FIG. 3H are views illustrating an image compensation process through the contrast compensation device of FIG. 2.
FIG. 3A shows a night mountain image that looks dark on the whole. Accordingly, if a probability density function is expressed based on calculated luminance degrees of respective pixels forming the image of FIG. 3A, a distribution of a plurality of dark colors is seen as shown in FIG. 3B. FIG. 3C shows a cumulative distribution function obtained through Formula 1 for FIG. 3B, and FIG. 3D is obtained when the cumulative distribution function obtained for FIG. 3C is converted into a gray scale of 256 levels. FIG. 3D is used herein to illustrate a mapping function for mapping an image signal. For example, if the input image is dark overall and any one of the pixels forming the input image has 100 gray levels, the mapping unit 30 maps the image to have 80 gray levels.
In the meantime, as shown in FIG. 3E, if the moon C of high luminance emerges on the upper right side between night mountains A and the night sky B on an image, a probability density function is formed as shown in FIG. 3F. The left side of FIG. 3F indicates a distribution of pixels of low luminance, and the right side of the same indicates distribution of pixels of high luminance. A cumulative distribution function obtained for FIG. 3F based on Formula 1 is as shown in FIG. 3G. FIG. 3H is obtained when the accumulative distribution function of FIG. 3G is converted into a 256-level gray scale, and, when FIG. 3H is used as a mapping function, 100 gray levels are mapped into 120 gray levels, because a slope of the cumulative distribution function rapidly increases when the probability density function for the bright moon A is accumulated with the probability density function of FIG. 3F. When FIG. 3H is used as a mapping function, an average luminance of all pixels forming the image increases. That is, not only is the position where the moon C emerges brightened, but the entire image also is brightened. Accordingly, the entire image has a high luminance, and the mountains A, sky B, and moon C become indistinct in luminance therebetween, and thus the image is blurred. That is, contrast ratios are degraded.